<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<header>

</header>
<body>
<script src="/static/assets/js/jquery.min.js"></script>
<script src="/static/assets/js/common.js"></script>

<script>
    $(function () {
        var code = getQueryVariable("code");
        var state = getQueryVariable("state");
        $.ajax({
            //几个参数需要注意一下
            type: "GET",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            url: "/feishu/ssoBackCall?code=" + code + "&state=" + state,//url
            data: $('#form').serialize(),
            success: function (result) {
                console.log(result);//打印服务端返回的数据(调试用)
                if (result.code == 200) {
                    window.location.href = '/profile';
                } else {
                    window.location.href = '/error/message?message=' + encodeURI(result.msg);
                }
            },
            error: function (result) {
                console.log(result);//打印服务端返回的数据(调试用)
                alert(result);
            }
        });
    });
</script>
</body>

</html>